home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir40 / mkprt101.zip / MAKEPORT.PAS < prev   
Pascal/Delphi Source File  |  1994-05-12  |  1KB  |  41 lines

  1. program makeport;    {This program installes com ports not installed because
  2.                       of buggy BIOSes often when a 16550 is installed, or
  3.                       deinstalled by DOS sometimes.  Simply put makeport in
  4.                       the autoexec.bat file, and the ports will be installed
  5.                       when you boot the computer.  The command format is:
  6.                          MAKEPORT           This will install com1
  7.                          MAKEPORT 1         This will also install com1
  8.                          MAKEPORT 2         This will install com2
  9.                          MAKEPORT 3         This will install com3 at 3E8
  10.                          MAKEPORT 4         This will install com4 at 2E8}
  11.  
  12. {Added 5/12/94 by Neil Parks:  MAKEPORT P sets LPT1 to hex 378}
  13.  
  14. var port :array [1..5] of word absolute $40:0;
  15.     portnum,errorcode :word;
  16.  
  17. begin
  18.   if paramcount = 0 then
  19.     port[1] := $3f8
  20.   else
  21.   if (paramstr(1) = 'P') or (paramstr(1) = 'p') then
  22.     port[5] := $378
  23.   else
  24.   begin
  25.     val(paramstr(1),portnum,errorcode);
  26.     if errorcode <> 0 then
  27.     begin
  28.       writeln('Error ',errorcode,' converting ',paramstr(1),' to a number.');
  29.       halt(1);
  30.     end;
  31.     case portnum of
  32.  
  33.       1: port[1] := $3f8;
  34.       2: port[2] := $2f8;
  35.       3: port[3] := $3e8;
  36.       4: port[4] := $2e8;
  37.     else Writeln('Com ports 0 and over 4 not supported.')
  38.     end; {case of}
  39.   end;
  40. end.
  41.